#ifndef AVALON_SCOPEDGROUPCONNECTION_HPP
#define AVALON_SCOPEDGROUPCONNECTION_HPP
#include "Avalon/SignalHandling/GroupConnection.hpp"

namespace Avalon {
namespace SignalHandling {

  /*! \class ScopedGroupConnection
   *  \brief Ensures proper disconnection of a GroupConnection upon destruction.
   *  \author Kamal Mansouri <kranar@hotmail.com>
   */
  class ScopedGroupConnection : public GroupConnection,
      private boost::noncopyable {
    public:

      //! Constructs a ScopedGroupConnection.
      ScopedGroupConnection();

      //! Constructs a ScopedGroupConnection from a GroupConnection.
      /*!
        \param connection The GroupConnection to copy the connections from.
      */
      ScopedGroupConnection(const GroupConnection& connection);

      ~ScopedGroupConnection();

      //! Assigns a GroupConnection to this.
      /*!
        \param rhs The right hand side of the assignment.
        \return A reference to this.
      */
      ScopedGroupConnection& operator =(const GroupConnection& rhs);
  };
}
}

#endif // AVALON_SCOPEDGROUPCONNECTION_HPP
